Skip to content

Operations endpoints: logspec handler#930

Open
gengur wants to merge 4 commits into
hyperledger:mainfrom
gengur:operations_logspec_handler
Open

Operations endpoints: logspec handler#930
gengur wants to merge 4 commits into
hyperledger:mainfrom
gengur:operations_logspec_handler

Conversation

@gengur

@gengur gengur commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

issue: #45

@gengur gengur requested a review from tock-ibm June 17, 2026 08:59
@gengur gengur force-pushed the operations_logspec_handler branch 2 times, most recently from 9cb3525 to aaa9cb2 Compare June 17, 2026 09:07
@DorKatzelnick DorKatzelnick requested a review from Copilot June 17, 2026 11:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a /logspec operations endpoint (Fabric-style) to allow updating runtime logging spec, and wires it into node startup logs plus fault-tolerance tests that validate changing log level during execution (issue #45 “Operations Service”).

Changes:

  • Register /logspec handler in the operations system using fabric-lib-go/common/flogging/httpadmin.
  • Log the logspec service URL during node startup (router/consenter/batcher/assembler).
  • Add test utilities + fault-tolerance tests that GET/PUT /logspec and assert debug logging appears after update.

Reviewed changes

Copilot reviewed 10 out of 12 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
vendor/modules.txt Vendors the httpadmin package path.
vendor/github.com/hyperledger/fabric-lib-go/common/flogging/httpadmin/spec.go Adds the vendored logspec HTTP handler implementation.
common/operations/system.go Registers /logspec handler and exposes a LogSpecServiceURL helper.
node/router/router.go Logs logspec service URL on router init.
node/consensus/consensus.go Logs logspec service URL on consenter start.
node/batcher/batcher.go Logs logspec service URL on batcher run.
node/assembler/assembler.go Logs logspec service URL on assembler creation.
testutil/network_utils.go Adds helpers to capture /logspec URL and GET/PUT its JSON payload.
test/faulttolerance/router_test.go Adds logspec runtime-change test for router.
test/faulttolerance/consensus_test.go Adds logspec runtime-change test for consenter.
test/faulttolerance/batcher_test.go Adds logspec runtime-change test for batcher.
test/faulttolerance/assembler_test.go Adds logspec runtime-change test for assembler.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +169 to +182
// parameters:
// - name: payload
// in: formData
// type: string
// description: The payload must consist of a single attribute named spec.
// required: true
// responses:
// '204':
// description: No content.
// '400':
// description: Bad request.
// consumes:
// - multipart/form-data
s.RegisterHandler("/logspec", httpadmin.NewSpecHandler(), s.options.TLS.Enabled)
Comment thread test/faulttolerance/router_test.go Outdated
Comment on lines +372 to +376
rl, err := armageddon.NewRateLimiter(rate, fillInterval, capacity)
if err != nil {
fmt.Fprintf(os.Stderr, "failed to start a rate limiter")
os.Exit(3)
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Comment thread test/faulttolerance/router_test.go Outdated
Comment on lines +382 to +386
status := rl.GetToken()
if !status {
fmt.Fprintf(os.Stderr, "failed to send tx %d", i+1)
os.Exit(3)
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Comment thread test/faulttolerance/consensus_test.go Outdated
Comment on lines +235 to +239
rl, err := armageddon.NewRateLimiter(rate, fillInterval, capacity)
if err != nil {
fmt.Fprintf(os.Stderr, "failed to start a rate limiter")
os.Exit(3)
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Comment thread test/faulttolerance/consensus_test.go Outdated
Comment on lines +245 to +249
status := rl.GetToken()
if !status {
fmt.Fprintf(os.Stderr, "failed to send tx %d", i+1)
os.Exit(3)
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Comment thread test/faulttolerance/batcher_test.go Outdated
Comment on lines +568 to +572
status := rl.GetToken()
if !status {
fmt.Fprintf(os.Stderr, "failed to send tx %d", i+1)
os.Exit(3)
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Comment thread test/faulttolerance/assembler_test.go Outdated
Comment on lines +339 to +343
rl, err := armageddon.NewRateLimiter(rate, fillInterval, capacity)
if err != nil {
fmt.Fprintf(os.Stderr, "failed to start a rate limiter")
os.Exit(3)
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Comment thread test/faulttolerance/assembler_test.go Outdated
Comment on lines +349 to +353
status := rl.GetToken()
if !status {
fmt.Fprintf(os.Stderr, "failed to send tx %d", i+1)
os.Exit(3)
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Comment thread testutil/network_utils.go
Comment thread testutil/network_utils.go
Comment on lines +153 to +155
req.Header.Set("Content-Type", "application/json")
return http.DefaultClient.Do(req)
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed as suggested

@gengur gengur force-pushed the operations_logspec_handler branch from 5f80425 to cfee6f0 Compare June 17, 2026 12:53
@tock-ibm tock-ibm force-pushed the operations_logspec_handler branch from cfee6f0 to d8a6a4b Compare June 22, 2026 13:16
@gengur gengur force-pushed the operations_logspec_handler branch 8 times, most recently from b1e003f to 01ba700 Compare July 1, 2026 07:30
@gengur gengur force-pushed the operations_logspec_handler branch from 01ba700 to af1541a Compare July 2, 2026 10:10
gengur added 4 commits July 2, 2026 11:04
Signed-off-by: Genady Gurevich <genadyg@il.ibm.com>
Signed-off-by: Genady Gurevich <genadyg@il.ibm.com>
Signed-off-by: Genady Gurevich <genadyg@il.ibm.com>
Signed-off-by: Genady Gurevich <genadyg@il.ibm.com>
@gengur gengur force-pushed the operations_logspec_handler branch from af1541a to 97be911 Compare July 2, 2026 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants